package others;

import java.io.File;

import tool.DataFileHandler;

import model.ConfigModel;

public class TimeTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		if(args.length < 2) {
			System.out.println("Please enter a configuration file name");
			return;
		}
		
		try {
			File file = new File("tempDir");
			file.mkdirs();
			
			long start = System.currentTimeMillis();
			
			ConfigModel model = DataFileHandler.parseDataFile(args[1]);
			model.store(file.getName());

			long duaration = System.currentTimeMillis() - start;

			System.out.println("\nThe parsing and storing process takes "
					+ (duaration / 60000) + " minutes and " + ((duaration % 60000)/1000)
					+ " seconds in total.");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
